package com.bclz.netty.simplehttpServer;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpServerCodec;


public class HttpServerInitializer extends ChannelInitializer<SocketChannel> {


    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();
        //netty提供的http 编解码器
        pipeline.addLast("httpCodec",new HttpServerCodec());
        pipeline.addLast("httpHandle",new HttpServerHandle());
    }


}
